import {NextRequest, NextResponse} from "next/server";
import {randomUUID} from "node:crypto";

export async function POST(request: NextRequest) {
    const {email, password} = await request.json();
    console.log(email, password);
    let auth_token = randomUUID();
    if (email == "78080114@qq.com" && password == "lirui123456.") {
        const response = NextResponse.json({
            success: true,
            data: '',
            msg: '',
        })
        response.cookies.set("auth-token", auth_token, {path: "/", maxAge: 86400, httpOnly: true})
        return response;
    }
    return NextResponse.json({
        success: false,
        data: '',
        msg: '用户名密码错误',
    })
}


